// components/navigation/navigation.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    unNavigationStyle: {
      type: Boolean,
      value: false,
    },
    hideBackBtn: {
      type: Boolean,
      value: false,
    },
    title: {
      type: String,
      value: "运动数据中心"
    },
    isCustomTitle: {
      type: Boolean,
      value: false
    },
    customStyle: {
      type: String,
      value: ""
    },
    noHeight: { //是否占据高度（即是否沉浸式）
      type: Boolean,
      value: false
    },
    openType:null,
  },

  /**
   * 组件的初始数据
   */
  data: {
    padBar: 20, //通知栏高
    barHeight: 20, //通知栏定位高
    height: 88, //导航栏高度
  },
  ready: function() {
    var that = this;
    var temp = {};
    wx.getSystemInfo({
      success: function(res) {
        temp.barHeight = res.statusBarHeight;
        temp.padBar = res.statusBarHeight;
        that.setData(temp);
      }
    })

  },

  /**
   * 组件的方法列表
   */
  methods: {
    navigationBack: function() {
      var that = this;
      const openType = that.data.openType;
      if (openType != "none") wx.navigateBack();
      that.triggerEvent('navigationBack');
    }
  }
})